package com.xiang.design.chainResponsibility.client;


import com.xiang.design.chainResponsibility.Impl.CfoHandle;
import com.xiang.design.chainResponsibility.Impl.DepartmentHandle;
import com.xiang.design.chainResponsibility.Impl.GroupHandle;

/**
 * 客户端处理
 *
 * @author xiangtianlei
 * @date 2023/03/15
 */
public class ClientHandle {

    public static void main(String[] args) {
        GroupHandle groupHandle = new GroupHandle();
        DepartmentHandle departmentHandle = new DepartmentHandle();
        CfoHandle cfoHandle = new CfoHandle();
        groupHandle.setNextHandle(departmentHandle);
        departmentHandle.setNextHandle(cfoHandle);
        // 我申请3000需要提交给小组领导审批
        if (groupHandle.handle(8000)) {
            System.out.println("申请成功!");
        } else {
            System.out.println("申请金额较大,不批准");
        }
    }
}
